<h1>Listing planets</h1>

<table>
  <tr>
    <th>Name</th>
    <th>Diameter in kilometers</th>
    <th>Kilograms</th>
    <th>Average kilometers from sun</th>
  </tr>

<% for planet in @planets %>
  <tr>
    <td><%=h planet.name %></td>
    <td><%=h planet.diameter_in_kilometers %></td>
    <td><%=h planet.kilograms %></td>
    <td><%=h planet.average_kilometers_from_sun %></td>
    <td><%= link_to 'Show', planet %></td>
    <td><%= link_to 'Edit', edit_planet_path(planet) %></td>
    <td><%= link_to 'Destroy', planet, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New planet', new_planet_path %>
